// import request from '../utils/request'

// const headers = {
//   'Content-Type': 'application/json',
//   Accept: 'application/json'
// }

import request from '../utils/request'
const headers = {
  'Content-Type': 'application/json',
  Accept: 'application/json'
}
import qs from 'qs'
export const getAdminList = data => {
  return request({
    url: '/admin/manager/getManager',
    method: 'post',
    data: JSON.stringify(data),
    headers
  })
}

export const addAdmin = data => {
  return request({
    url: '/admin/manager/add',
    method: 'post',
    data: JSON.stringify(data),
    headers
  })
}

export const updateAdmin = data => {
  return request({
    url: '/admin/manager/update',
    method: 'post',
    data: JSON.stringify(data),
    headers
  })
}

export const deleteAdmin = data => {
  return request({
    url: '/admin/manager/delete',
    method: 'DELETE',
    params: data,
    headers
  })
}

export const getRoleList = data => {
  return request({
    url: '/admin/role/getRole',
    method: 'post',
    data: JSON.stringify(data),
    headers
  })
}

export const deleteRole = data => {
  return request({
    url: '/admin/role/delete',
    method: 'get',
    params: data
  })
}

export const getPrivilegeList = data1 => {
  const data = {
    userId: localStorage.getItem('userid')
  }
  return request({
    url: '/admin/manager/getPrivileges',
    method: 'get',
    params: data,
    headers
  })
}

export const getExamineIdentity = data => {
  return request({
    url: '/opUser/examineIdentity',
    method: 'post',
    data: JSON.stringify(data),
    headers
  })
}

export const setRole = data => {
  return request({
    url: '/admin/role/update',
    method: 'post',
    data: JSON.stringify(data),
    headers
  })
}

export const addRole = data => {
  return request({
    url: '/admin/role/add',
    method: 'post',
    data: data,
    headers
  })
}
